CREATE TABLE [dbo].[DnnProduct_UsersOnline]
(
[UserID] [int] NOT NULL,
[PortalID] [int] NOT NULL,
[TabID] [int] NOT NULL,
[CreationDate] [datetime] NOT NULL CONSTRAINT [DF__DnnProduct_Users__Creat__3BFFE745] DEFAULT (getdate()),
[LastActiveDate] [datetime] NOT NULL CONSTRAINT [DF__DnnProduct_Users__LastA__3CF40B7E] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_UsersOnline] ADD CONSTRAINT [PK_DnnProduct_UsersOnline] PRIMARY KEY CLUSTERED  ([UserID], [PortalID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DnnProduct_UsersOnline] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_UsersOnline_DnnProduct_Portals] FOREIGN KEY ([PortalID]) REFERENCES [dbo].[DnnProduct_Portals] ([PortalID]) ON DELETE CASCADE NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[DnnProduct_UsersOnline] WITH NOCHECK ADD CONSTRAINT [FK_DnnProduct_UsersOnline_DnnProduct_Users] FOREIGN KEY ([UserID]) REFERENCES [dbo].[DnnProduct_Users] ([UserID]) ON DELETE CASCADE NOT FOR REPLICATION
GO
